<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>文章</title>
		<link rel="stylesheet" type="text/css" href="./public/bt/css/bootstrap.min.css" />
		<style type="text/css">
			.container{
				padding:30px 20px;
				margin: 20px auto;
				background: url(./img/333603-106.jpg);
				color: gray;
				font-family: "微软雅黑";
			}
			.wen1{
				display: block;
				overflow:hidden;
			    white-space:nowrap;
			    text-overflow:ellipsis;
			    width: 240px;
			    font-size: 15px;
			
			}
			.wen2{
				font-size: 20px;
				color: burlywood;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<button type="button" class="btn btn-sm btn-block" style="font-size: 25px;">文章管理系统</button>
			<table class="table table-hover">
				<tr class="wen2">
					<td width="50">ID</td>
					<td width="260">标题</td>
					<td width="150">作者</td>
					<td>内容</td>
					<td width="200">发布时间</td>
					<td width="300">操作</td>
				</tr>
				<?php foreach($data as $k => $v): ?>
					<tr>
						<td><?php echo $k ?></td>
						<td><a href="?a=show&id=<?php echo $k?>" target="_blank"><?php echo $v['title'] ?></a></td>
						<td><?php echo $v['author'] ?></td>
						<td class="wen1"><?php echo $v['content'] ?></td>
						<td><?php echo date('Y-m-d',$v['sendtime']) ?></td>
						<td>
							<a href="?a=edit&id=<?php echo $k?>" class="btn btn-primary btn-sm active" role="button">编辑</a>
							<a href="javascript:;" class="btn btn-danger btn-sm active" role="button" onclick="if(confirm('确认删除吗？')){window.location.href='index.php?a=del&id=<?php echo $k?>'}">删除</a>
						</td>
					</tr>
				<?php endforeach ?>
			</table>
			<a href="?a=add" class="btn btn-default btn-sm active btn-block" role="button" ><h4>发布文章</h4></a>
		</div>
	</body>

</html>